package stringMethods;

import java.util.Arrays;

public class Demo02 {
    public static void main(String[] args) {
        /**
         * 字符串截取
         * substring
         */
        String s = "woyaoxuejava";
        String s1 = s.substring(2, 4);
        String s2 = s.substring(4);
        System.out.println(s1);
        System.out.println(s2);

        /**
         * 字符替换
         * replace
         */
        String s3 = s.replace("yao", "bu");
        System.out.println(s3);
        /**
         * 字符串切割
         */
        String ss = "1,2,3,4";
        String[] l = ss.split(",");
        System.out.println(Arrays.toString(l));
    }
}
